package cn.tedu.adminsystem.webapi.preload;

import cn.tedu.adminsystem.service.NoticeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;


/**
 * 储存预热，项目启动完成时执行
 */
@Slf4j
//@Component
public class CachePreLoad implements ApplicationRunner {

    @Autowired
    private NoticeService noticeService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.debug("项目启动完成，开始执行重建公告redis缓存");
//        noticeService.rebuildCache();
        log.debug("-----------重建公告redis缓存完成！-------------");
    }
}
